package org.mxp;

import lombok.extern.slf4j.Slf4j;
import org.mxp.wobsocket.WebSocketServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@SpringBootApplication
// 开启定时任务
@EnableScheduling
public class Application {

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(Application.class, args);
        WebSocketServer.setApplicationContext(applicationContext);
        Environment environment = applicationContext.getEnvironment();
        log.info("http://localhost:" + environment.getProperty("server.port"));
    }

}
